﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel; 

namespace InscriberControlClient
{
    /// <summary>
    /// Interaction logic for Window5.xaml
    /// </summary>
    public partial class Window5 : Window
    {
        public ObservableCollection<Logo> lg;
        public static bool isMove = false;

        public Window5()
        {
            InitializeComponent();
            peopleListBox.DataContext = lg;
        }
        private void Button_Click1(object sender, RoutedEventArgs e)
        {
            lg = Functionality.getLogo("");
            peopleListBox.DataContext = lg;
        }

        private void Button_Click2(object sender, RoutedEventArgs e)
        {
            this.Hide();
        }

        private void cmdRunLD_Clicked(object sender, RoutedEventArgs e)
        {

            Button cmd = (Button)sender;
            if (cmd.DataContext is Logo)
            {

                Logo item = (Logo)cmd.DataContext;
                Functionality.startLG(item.nr.ToString());

            }

        }

        private void cmdStopLD_Clicked(object sender, RoutedEventArgs e)
        {

            Button cmd = (Button)sender;
            if (cmd.DataContext is Logo)
            {

                Logo item = (Logo)cmd.DataContext;
                Functionality.stopLG(item.nr.ToString());
            }

        }

        private void Window_MouseDown(object sender, MouseButtonEventArgs e)
        {
      
        }

        private void peopleListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }

        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
           /* isMove = true;
            Functionality.lastPosition = Mouse.GetPosition(this);*/
        }


        private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            isMove = false;
        }

        private void Window_MouseMove(object sender, MouseEventArgs e)
        {
          /*  if (isMove)
            {
                System.Windows.Point pt = Mouse.GetPosition(this);
                Functionality.DragMoveNew(this, e, pt);
            }*/
        }

        private void Window_MouseLeave(object sender, MouseEventArgs e)
        {
            isMove = false;
        }
    }
}
